﻿namespace MefContrib.Models.Provider.Tests
{
    using System.Collections.ObjectModel;
    using NUnit.Framework;

    [TestFixture]
    public class ImportDescriptionTests
    {
        [Test]
        public void AllowDefaultShouldStoreSetValue()
        {
            ImportDescription description =
                new ImportDescription { AllowDefault = true };

            Assert.IsTrue(description.AllowDefault);
        }

        [Test]
        public void ContractShouldStoreSetValue()
        {
            ImportDescription description =
                new ImportDescription { ContractName = "dummy value" };

            Assert.AreEqual(description.ContractName, "dummy value");
        }

        [Test]
        public void MemberNameShouldStoreSetValue()
        {
            ImportDescription description =
                new ImportDescription { MemberName = "dummy value" };

            Assert.AreEqual(description.MemberName, "dummy value");
        }

        [Test]
        public void MetadataShouldStoreSetValue()
        {
            Collection<string> metadata =
                new Collection<string>();

            ImportDescription description =
                new ImportDescription { RequiredMetadata = metadata };

            Assert.AreSame(description.RequiredMetadata, metadata);
        }

        [Test]
        public void PrerequisiteShouldStoreSetValue()
        {
            ImportDescription description =
                new ImportDescription { Prerequisite = true };

            Assert.IsTrue(description.Prerequisite);
        }

        [Test]
        public void RecomposableShouldStoreSetValue()
        {
            ImportDescription description =
                new ImportDescription { Recomposable = true };

            Assert.IsTrue(description.Recomposable);
        }
    }
}